package kr.saeildamil.androidstudy.ch07;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class PrePaintEx extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyView3 mv3 = new MyView3(this);
		setContentView(mv3);
	}
	
	class MyView3 extends View {
		Paint mPaint;
		public MyView3(Context context) {
			super(context);
			mPaint = new Paint();
			mPaint.setAntiAlias(true);
			mPaint.setColor(Color.BLUE);
			mPaint.setStrokeWidth(10);
			mPaint.setStyle(Paint.Style.STROKE);
			mPaint.setStrokeJoin(Paint.Join.BEVEL);			
		}
		protected void onDraw(Canvas canvas) {
			canvas.drawColor(Color.LTGRAY);
			canvas.drawRect(10, 10, 300, 400, mPaint);
		}

	}
}
